#include "TrueText/Config.h"
#include "TrueText/Face.h"
#include "TrueText/Stream.h"
#include "FaceImpl.h"
#include <boost/function.hpp>

namespace TrueText {

Face::Face(std::string id, boost::function<boost::shared_ptr<Stream> ()> dataLoader)
    : impl(new FaceImpl(id, dataLoader))
{
}

Face::Face(const Face& rhs)
    : impl(new FaceImpl(*rhs.impl.get()))
{ }

const Face& Face::operator=(const Face& rhs)
{
    if (this == &rhs)
        return *this;

    impl.reset(new FaceImpl(*rhs.impl.get()));

    return *this;
}

Face::~Face()
{ }

std::string Face::GetFamilyName() const
{
    return impl->GetFamilyName();
}

std::string Face::GetStyleName() const
{
    return impl->GetStyleName();
}

boost::shared_ptr<FaceImpl> Face::getImpl() const
{
    return impl;
}

}